package com.deco.domain.vo.sys;


import com.deco.domain.vo.constants.CmsConstant;
import com.free.utils.DateUtils;

import java.sql.Timestamp;

public class CmsRoleVo implements java.io.Serializable {

    private static final long serialVersionUID = -5416588140124979816L;

    // Fields

    private Integer id;
    private String name;
    private Integer type;
    private Integer status;
    private String menus;
    private Integer createBy;
    private Timestamp createTime;
    private Integer updateBy;
    private Timestamp updateTime;
    private Boolean active = false;

    // Constructors

    /** default constructor */
    public CmsRoleVo() {
    }

    // Property accessors

    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getType() {
        return this.type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getStatus() {
        return this.status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMenus() {
        return this.menus;
    }

    public void setMenus(String menus) {
        this.menus = menus;
    }

    public Integer getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(Integer createBy) {
        this.createBy = createBy;
    }

    public Timestamp getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public Integer getUpdateBy() {
        return this.updateBy;
    }

    public void setUpdateBy(Integer updateBy) {
        this.updateBy = updateBy;
    }

    public Timestamp getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    /* 格式化 */

    public String getTypeFmt() {
        return CmsConstant.ROLE_TYPE_MAP.get(this.type);
    }

    public String getUpdateTimeFmt() {
        return this.updateTime == null ? "" : DateUtils.convert2String(this.updateTime,DateUtils.FormatEnum.yyyy_MM_dd_HH_mm_ss);
    }

    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }

    @Override
    public String toString() {
        return "CmsRoleVo{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", type=" + type +
                ", status=" + status +
                ", menus='" + menus + '\'' +
                ", createBy=" + createBy +
                ", createTime=" + createTime +
                ", updateBy=" + updateBy +
                ", updateTime=" + updateTime +
                '}';
    }
}